package com.speedricemanager.net;

import android.content.Context;

import com.jbm.core.iface.IAcross;
import com.jbm.jsm.iface.ArbitrateEntity;
import com.jbm.jsm.iface.BankCardEntity;
import com.jbm.jsm.iface.BankEntity;
import com.jbm.jsm.iface.CheatdatabaseEntity;
import com.jbm.jsm.iface.ConsumConfigEntity;
import com.jbm.jsm.iface.DepositLogEntity;
import com.jbm.jsm.iface.ExamEntity;
import com.jbm.jsm.iface.GeoInfoEntity;
import com.jbm.jsm.iface.IAplipay;
import com.jbm.jsm.iface.IAppVersion;
import com.jbm.jsm.iface.InvitationCodeEntity;
import com.jbm.jsm.iface.JinmiLogEntity;
import com.jbm.jsm.iface.MibaoLogEntity;
import com.jbm.jsm.iface.RoomEntity;
import com.jbm.jsm.iface.SmallAccountEntity;
import com.jbm.jsm.iface.TaskEntity;
import com.jbm.jsm.iface.TaskMouldEntity;
import com.jbm.jsm.iface.TaskMouldRequireEntity;
import com.jbm.jsm.iface.UserEntity;
import com.speedricemanager.other.application.MApplication;
import com.speedricemanager.other.base.BaseNet;
import com.speedricemanager.other.config.Config;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import rx.Observable;
import rx.Subscriber;
import rx.functions.Action1;

import static com.speedricemanager.other.config.Config.PAGESIZE;
import static com.speedricemanager.other.server.ServerModel.getInterface;
import static com.speedricemanager.other.utils.LoginUtils.getIp;
import static com.speedricemanager.other.utils.LoginUtils.getLocalMacAddressFromWifiInfo;


public class AllNet extends BaseNet {
    public AllNet(Action1 action) {
        super(action);
    }


    //绑定银行卡
    public void bindBankCard(final String province,final String city,final String bank, final String mobile, final String card, final String vcode){
        Observable1(new Observable.OnSubscribe<BankCardEntity>() {
            @Override
            public void call(Subscriber<? super BankCardEntity> subscriber) {
                BankCardEntity result = getInterface().bindBankCard(province,city,bank,mobile,card,vcode);
                subscriber.onNext(result);
            }
        });
    }
    //审核模板
    public void AuditTaskMould(final int tm_id, final int status, final String reason, final String userpay, final String requirement, final String doFlow, final String comment, final Date startdate, final Date enddate, final String rental, final String viceAccount, final String mainDeposit, final String viceDeposit, final List<TaskMouldRequireEntity> requireList){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().AuditTaskMould( tm_id,  status,  reason,  userpay,  requirement,  doFlow,  comment,  startdate,  enddate,  rental,  viceAccount,  mainDeposit,  viceDeposit, requireList);
                subscriber.onNext(result);
            }
        });
    }



    //获取地址
    public void getLevelGeoInfoList( final int prev_id){
        Observable1(new Observable.OnSubscribe<GeoInfoEntity>() {
            @Override
            public void call(Subscriber<? super GeoInfoEntity> subscriber) {
                GeoInfoEntity result = getInterface().getLevelGeoInfoList("f",prev_id);
                subscriber.onNext(result);
            }
        });
    }

    //获取已发布的商品
    public void getMyTaskList(final int taskstatus, final int paytype, final int plattype, final int start){
        Observable1(new Observable.OnSubscribe<TaskEntity>() {
            @Override
            public void call(Subscriber<? super TaskEntity> subscriber) {
                TaskEntity result = getInterface().getMyTaskList(taskstatus,paytype,plattype,start, PAGESIZE);
                subscriber.onNext(result);
            }
        });
    }
    //防骗数据库
    public void getCheatData(final String key){
        Observable1(new Observable.OnSubscribe<CheatdatabaseEntity>() {
            @Override
            public void call(Subscriber<? super CheatdatabaseEntity> subscriber) {
                CheatdatabaseEntity result = getInterface().getCheatData(key);
                subscriber.onNext(result);
            }
        });
    }


    //获取银行卡列表
    public void getMyBankCardList(){
        Observable1(new Observable.OnSubscribe<BankCardEntity>() {
            @Override
            public void call(Subscriber<? super BankCardEntity> subscriber) {
                BankCardEntity result = getInterface().getMyBankCardList();
                subscriber.onNext(result);
            }
        });
    }

//    //绑定银行卡
//    public void bindBankCard(final String bank, final String mobile, final String card, final String vcode){
//        Observable1(new Observable.OnSubscribe<BankCardEntity>() {
//            @Override
//            public void call(Subscriber<? super BankCardEntity> subscriber) {
//                BankCardEntity result = ServerModel.getInterface().bindBankCard(bank,mobile,card,vcode);
//                subscriber.onNext(result);
//            }
//        });
//    }


    //保证金充值
    public void rechargeDeposit(final int userID, final BigDecimal amount, final BigDecimal moneyamount, final BigDecimal serviceCharge){
        Observable1(new Observable.OnSubscribe<DepositLogEntity>() {
            @Override
            public void call(Subscriber<? super DepositLogEntity> subscriber) {
                DepositLogEntity result = getInterface().rechargeDeposit(userID,amount,moneyamount,serviceCharge);
                subscriber.onNext(result);
            }
        });
    }
    //获取所有银行
    public void getBankList(){
        Observable1(new Observable.OnSubscribe<BankEntity>() {
            @Override
            public void call(Subscriber<? super BankEntity> subscriber) {
                BankEntity result = getInterface().getBankList();
                subscriber.onNext(result);
            }
        });
    }


    //金米提现
    public void getCashApply(final int user_id, final int amount,final String type){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().getCashApply(user_id,amount,type);
                subscriber.onNext(result);
            }
        });
    }

    //获取推广码
//    <param name="keyword">关键字</param>
    //  <param name="iscert">是否实名认证</param>
    /// <param name="isaudit">是否审核通过</param>
    public void getInvitationCodeList(final String keyword, final int iscert, final int isaudit, final String startdate, final String enddate, final int status, final int start,final int pageSize){
        Observable1(new Observable.OnSubscribe<InvitationCodeEntity>() {
            @Override
            public void call(Subscriber<? super InvitationCodeEntity> subscriber) {
                InvitationCodeEntity result = getInterface().getInvitationCodeList(keyword,iscert,isaudit,startdate,enddate,status,start, pageSize);
                subscriber.onNext(result);
            }
        });
    }









    //我的垫付款冻结记录
    public void getMyIceUserPayList(final int start){

        Observable1(new Observable.OnSubscribe<TaskEntity>() {
            @Override
            public void call(Subscriber<? super TaskEntity> subscriber) {
                TaskEntity result = getInterface().getMyIceUserPayList(start, PAGESIZE);
                subscriber.onNext(result);
            }
        });
    }


    //我的佣金冻结记录
    public void getMyIceDepositList(final int start){
        Observable1(new Observable.OnSubscribe<TaskEntity>() {
            @Override
            public void call(Subscriber<? super TaskEntity> subscriber) {
                TaskEntity result = getInterface().getMyIceDepositList(start, PAGESIZE);
                subscriber.onNext(result);
            }
        });
    }

    //申请解冻
    public void iceoutApply(final int order_id){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().iceoutApply(order_id);
                subscriber.onNext(result);
            }
        });

    }

    /// <summary>
    /// 申请关注
    /// </summary>
    /// <param name="targetroom_id">目标房间</param>
    /// <param name="type">1关注 0取消关注</param>
    /// <returns></returns>
    public void roomFocusApply(final int targetroom_id, final int type){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().roomFocusApply(targetroom_id,type);
                subscriber.onNext(result);
            }
        });

    }






    //金米记录
    public void getMyJinmilist(final int start){
        Observable1(new Observable.OnSubscribe<JinmiLogEntity>() {
            @Override
            public void call(Subscriber<? super JinmiLogEntity> subscriber) {
                JinmiLogEntity result = getInterface().getMyJinmilist(1,null,null,null,start, PAGESIZE);
                subscriber.onNext(result);
            }
        });
    }
    //金米冻结 明细
    public void getMyJinmilist1(final int start){
        Observable1(new Observable.OnSubscribe<JinmiLogEntity>() {
            @Override
            public void call(Subscriber<? super JinmiLogEntity> subscriber) {
                JinmiLogEntity result = getInterface().getMyJinmilist(2,null,null,null,start, PAGESIZE);
                subscriber.onNext(result);
            }
        });
    }


    //米宝记录
    public void getMyMibaoList(final int start){
        Observable1(new Observable.OnSubscribe<MibaoLogEntity>() {
            @Override
            public void call(Subscriber<? super MibaoLogEntity> subscriber) {
                MibaoLogEntity result = getInterface().getMyMibaoList(start, PAGESIZE);
                subscriber.onNext(result);
            }
        });

    }

    //调起支付宝支付
    //  <param name="moneyamount">支付金额</param>
    //  <param name="amout">到账金额金额</param>
    //  <param name="serviceCharge">手续费</param>
    /// <param name="environment">环境 pc端1 ，手机端 2</param>
    /// <param name="type">保证金b  金米j</param>
    /// <param name="re_type">充值方式   支付宝:ali 招商银行:zs</param>
    /// <returns></returns>
    public void rechare(final BigDecimal moneyamount, final BigDecimal amout, final BigDecimal serviceCharge, final String type, final String re_type, Action1 action){
        Observable1(new Observable.OnSubscribe<IAplipay>() {
            @Override
            public void call(Subscriber<? super IAplipay> subscriber) {
                IAplipay result = (IAplipay) getInterface().rechare(moneyamount,amout,serviceCharge,2,type,re_type);
                subscriber.onNext(result);
            }
        });
    }


    //获取刷手题
    public void getExamList( final int type){
        Observable1(new Observable.OnSubscribe<ExamEntity>() {
            @Override
            public void call(Subscriber<? super ExamEntity> subscriber) {
                ExamEntity result = getInterface().getExamList(type);
                subscriber.onNext(result);
            }
        });
    }

    //米宝充值
    public void rechargeMibao(final int userId, final int amount, final BigDecimal price, final BigDecimal sum){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().rechargeMibao(userId,amount,price,sum);
                subscriber.onNext(result);
            }
        });
    }
    //获取用户  米宝充值之前的第一个框需要
    public void getUserInfo(final String account){
        Observable1(new Observable.OnSubscribe<UserEntity>() {
            @Override
            public void call(Subscriber<? super UserEntity> subscriber) {
                UserEntity result = getInterface().getUserInfo(account);
                subscriber.onNext(result);
            }
        });
    }

    //注册审核列表
    public void getAuditRegitlist(){
        Observable1(new Observable.OnSubscribe<UserEntity>() {
            @Override
            public void call(Subscriber<? super UserEntity> subscriber) {
                UserEntity result = getInterface().getAuditRegitlist();
                subscriber.onNext(result);
            }
        });
    }

    //同意申请和拒绝申请
    public void AuditRegist(final int user_id, final int status, final String reason, final String persion) {
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().AuditRegist(user_id, status, reason, persion);
                subscriber.onNext(result);
            }
        });
    }

    //获取用户所用权限
    public void getUserCanAuthList(final int user_id){
        Observable1(new Observable.OnSubscribe<UserEntity>() {
            @Override
            public void call(Subscriber<? super UserEntity> subscriber) {
                UserEntity result = getInterface().getUserCanAuthList(user_id);
                subscriber.onNext(result);
            }
        });
    }




    //获取用户信息
    public void getUserInfo(){
        Observable1(new Observable.OnSubscribe<UserEntity>() {
            @Override
            public void call(Subscriber<? super UserEntity> subscriber) {
                UserEntity result = getInterface().getUserInfo();
                subscriber.onNext(result);
            }
        });

    }

    //修改房间名片
    public void renameMyCard(final String name){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().renameMyCard(name);
                subscriber.onNext(result);
            }
        });
    }

//----------------------------------------
//修改密码
public void modPassword(final String oldpassword, final String newpassword ){
    Observable1(new Observable.OnSubscribe<IAcross>() {
        @Override
        public void call(Subscriber<? super IAcross> subscriber) {
            IAcross result = getInterface().modPassword(oldpassword,newpassword);
            subscriber.onNext(result);
        }
    });


}



    //修改接单密码
    public void modWorkPassword(final String oldpassword, final String newpassword ){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().modWorkPassword(oldpassword,newpassword);
                subscriber.onNext(result);
            }
        });


    }

    //修改绑定手机号
    public void modMobile(final String mobile, final String vcode, final String newMobile, final String newvcode ){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().modMobile(mobile,vcode,newMobile,newvcode);
                subscriber.onNext(result);
            }
        });

    }


    //修改小号备注名称
    public void modSmallAccount(final int sa_id, final String name ){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().modSmallAccount(sa_id,name);
                subscriber.onNext(result);
            }
        });

    }

    //删除小号
    public void delSmallAccount(final int sa_id ){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().delSmallAccount(sa_id);
                subscriber.onNext(result);
            }
        });
    }


    //用户申请权限
    public void authorityApply(final String auths){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().authorityApply(auths);
                subscriber.onNext(result);
            }
        });
    }
    //获取未有权限
    public void getNotAuthList(){
        Observable1(new Observable.OnSubscribe<UserEntity>() {
            @Override
            public void call(Subscriber<? super UserEntity> subscriber) {
                UserEntity result = getInterface().getNotAuthList();
                subscriber.onNext(result);
            }
        });
    }


    //我的小号列表    这个有俩个  orderModel 也存在
    public void getMyAccountList(final int  plat_type){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().getMyAccountList(plat_type);
                subscriber.onNext(result);
            }
        });
    }


    //获取奖励
    public void getMyMibaoListByType(final int type ){
        Observable1(new Observable.OnSubscribe<MibaoLogEntity>() {
            @Override
            public void call(Subscriber<? super MibaoLogEntity> subscriber) {
                MibaoLogEntity result = getInterface().getMyMibaoListByType("in",type,0,0);
                subscriber.onNext(result);
            }
        });
    }


    //获取房间
    public void getSubroomList(final int room_id ){
        Observable1(new Observable.OnSubscribe<RoomEntity>() {
            @Override
            public void call(Subscriber<? super RoomEntity> subscriber) {
                RoomEntity result = getInterface().getSubroomList(room_id,0,0);
                subscriber.onNext(result);
            }
        });
    }

    //生成邀请码
    public void createInvitationCode(final int room_id,final int numbers,final int identy ){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().createInvitationCode(room_id,numbers,identy);
                subscriber.onNext(result);
            }
        });

    }

    //添加团或组
//    <param name="prev_id">上级id</param>
    /// <param name="leader">团长or 组长</param>
    /// <param name="level">级别 1团 2组</param>
    /// <param name="name">名称</param>
    public void addGroup(final int prev_id, final int leader, final int level, final String name ) {
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().addGroup(prev_id, leader, level, name);
                subscriber.onNext(result);
            }
        });
    }


    //同步小号
    public void synchSmallAccount(final SmallAccountEntity entity){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().synchSmallAccount(entity);
                subscriber.onNext(result);
            }
        });
    }
    //再次申请
    public void reRegist(){
        Observable1(new Observable.OnSubscribe<UserEntity>() {
            @Override
            public void call(Subscriber<? super UserEntity> subscriber) {
                UserEntity result = getInterface().reRegist();
                subscriber.onNext(result);
            }
        });

    }
    //我的仲裁列表
    public void getMyArbitrateList(final int status, final String key, final int start){
        Observable1(new Observable.OnSubscribe<ArbitrateEntity>() {
            @Override
            public void call(Subscriber<? super ArbitrateEntity> subscriber) {
                ArbitrateEntity result = getInterface().getMyArbitrateList(status,key,start, PAGESIZE);
                subscriber.onNext(result);
            }
        });

    }




    /**
     * 获取税率
     */
    public void getConsumConfigList() {

        Observable1(new Observable.OnSubscribe<ConsumConfigEntity>() {
            @Override
            public void call(Subscriber<? super ConsumConfigEntity> subscriber) {
                ConsumConfigEntity result = getInterface().getConsumConfigList();
                subscriber.onNext(result);
            }
        });

    }

    /**
     * 我的推广
     * 根据组获取团
     */
    public void getBaeeRoomInfo(final int room_id) {
        Observable1(new Observable.OnSubscribe<RoomEntity>() {
            @Override
            public void call(Subscriber<? super RoomEntity> subscriber) {
                RoomEntity result = getInterface().getBaeeRoomInfo(room_id);
                subscriber.onNext(result);
            }
        });

    }
    /**
     * 商家获取订单列表
     * @param task_id
     * @param start
     */
    public void getTaskOrderList(final int task_id, final int start) {
        Observable1(new Observable.OnSubscribe<TaskEntity>() {
            @Override
            public void call(Subscriber<? super TaskEntity> subscriber) {
                TaskEntity result = getInterface().getTaskOrderList(task_id,start, PAGESIZE);
                subscriber.onNext(result);
            }
        });

    }

    //订单列表
    public void getMyOrdderlist(final int platType, final Integer status, final int start){
        Observable1(new Observable.OnSubscribe<TaskEntity>() {
            @Override
            public void call(Subscriber<? super TaskEntity> subscriber) {
                TaskEntity aaa = getInterface().getMyOrdderlist(status,platType,0,"",start, PAGESIZE);
                subscriber.onNext(aaa);
            }
        });
    }


    //---------------------------------------------------------
    //检测邀请码
    public void verifyInvitation(final String yqm){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross backData = getInterface().verifyInvitation(yqm);
                subscriber.onNext(backData);
            }
        });
    }
    //获取验证码
    public void createVCode(final String phone, final String type){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross backData = getInterface().createVCode(phone, type);
                subscriber.onNext(backData);
            }
        });
    }
    //版本更新
    public void GetLastVersion(final int start, final int end){
        Observable1(new Observable.OnSubscribe<IAppVersion>() {
            @Override
            public void call(Subscriber<? super IAppVersion> subscriber) {
                IAppVersion backData = getInterface().GetLastVersion("jsm.android",start,end, 0, 0);
                subscriber.onNext(backData);
            }
        });
    }



    //检测昵称
    public void nicknamerepeate(final String nickName){
        //registerNickname.getText().toString()
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross backData = getInterface().nicknamerepeate(nickName);
                subscriber.onNext(backData);
            }
        });
    }
    //注册
    public void registUser(final String mobile, final String invitation_code, final String vcode, final String nickname, final String password, final String  qq){
        Observable1(new Observable.OnSubscribe<UserEntity>() {
            @Override
            public void call(Subscriber<? super UserEntity> subscriber) {
                UserEntity backData = getInterface().registUser(mobile,invitation_code,vcode,nickname,password,qq, Config.AREA);
                subscriber.onNext(backData);
            }
        });
    }
    //设置接单密码
    public void setWorkPass(final String password){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross backData = getInterface().setWorkPass(password);
                subscriber.onNext(backData);
            }
        });

    }



    //登录页面的登陆
    public void login(final String usname, final String password, final Context context){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                UserEntity aaa = getInterface().login(usname,password,getIp(context),getLocalMacAddressFromWifiInfo(context), MApplication.city , Config.AREA,MApplication.address);
                subscriber.onNext(aaa);
            }
        });
    }
    //登录页面的登陆
    public void adminLogin(final String usname, final String password, final Context context){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                UserEntity aaa = getInterface().adminLogin(usname,password,getIp(context),getLocalMacAddressFromWifiInfo(context), MApplication.city , Config.AREA,MApplication.address);
                subscriber.onNext(aaa);
            }
        });
    }

    //验证接单密码
    public void verifyWorkPass(final String password){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().verifyWorkPass(password);
                subscriber.onNext(result);
            }
        });
    }

    //忘记密码
    public void forgetPass(final String mobile, final String vcode, final String password){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().forgetPass(mobile,vcode,password);
                subscriber.onNext(result);
            }
        });
    }

    //忘记接单密码
    public void forgetWorkPass(final String mobile, final String vcode, final String password){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().forgetWorkPass(mobile,vcode,password);
                subscriber.onNext(result);
            }
        });
    }

    //切换账号
    public void Logout(){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().Logout();
                subscriber.onNext(result);
            }
        });
    }


    //抢单列表
    public void getcompetOrderList(final int task_id){
        Observable1(new Observable.OnSubscribe<TaskEntity>() {
            @Override
            public void call(Subscriber<? super TaskEntity> subscriber) {
                TaskEntity result = getInterface().getcompetOrderList(task_id,0, PAGESIZE);
                subscriber.onNext(result);
            }
        });
    }


//saveTaskModule  保存模板
    //getMyModuleList  获取模板
    //getGeoInfoList  获取全国
    //saveTask


    //保存模板
    public void saveTaskModule(final TaskMouldEntity taskMould){
        Observable1(new Observable.OnSubscribe<TaskMouldEntity>() {
            @Override
            public void call(Subscriber<? super TaskMouldEntity> subscriber) {
                TaskMouldEntity result = getInterface().saveTaskModule(taskMould);
                subscriber.onNext(result);
            }
        });
    }

    //获取全国地址
    public void getGeoInfoList(){
        Observable1(new Observable.OnSubscribe<GeoInfoEntity>() {
            @Override
            public void call(Subscriber<? super GeoInfoEntity> subscriber) {
                GeoInfoEntity result = getInterface().getGeoInfoList("s");
                subscriber.onNext(result);
            }
        });
    }
    //发布任务
    public void saveTask(final TaskEntity task){
        Observable1(new Observable.OnSubscribe<TaskEntity>() {
            @Override
            public void call(Subscriber<? super TaskEntity> subscriber) {
                TaskEntity result = getInterface().saveTask(task);
                subscriber.onNext(result);
            }
        });
    }

    //修改邀请码备注
    public void modInvatation(final int id, final String memo){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result = getInterface().modInvatation(id,memo);
                subscriber.onNext(result);
            }
        });
    }

    //获取保证金明细
    public void getMyDepositlist(final int start){
        Observable1(new Observable.OnSubscribe<DepositLogEntity>() {
            @Override
            public void call(Subscriber<? super DepositLogEntity> subscriber) {
                DepositLogEntity result = getInterface().getMyDepositlist(start, PAGESIZE);
                subscriber.onNext(result);
            }
        });
    }

    //获取发布任务的钱
    public void countTaskMondy(final TaskEntity task){
        Observable1(new Observable.OnSubscribe<TaskEntity>() {
            @Override
            public void call(Subscriber<? super TaskEntity> subscriber) {
                TaskEntity result = getInterface().countTaskMondy(task);
                subscriber.onNext(result);
            }
        });
    }

    //抢单同意与拒绝
    public void checkCompetOrder(final int order_id,final int result){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result1 = getInterface().checkCompetOrder( order_id,result);
                subscriber.onNext(result1);
            }
        });
    }


    //商家取消订单
    public void cancelOrderSJ(final int order_id){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result1 = getInterface().cancelOrderSJ( order_id);
                subscriber.onNext(result1);
            }
        });
    }

    //商家做单完成
    public void overOrderSJ(final int order_id, final String orderNum){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result1 = getInterface().overOrderSJ( order_id,orderNum);
                subscriber.onNext(result1);
            }
        });
    }

    //商家点击收菜完成
    public void allOverOrderSJ(final int order_id){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result1 = getInterface().allOverOrderSJ( order_id);
                subscriber.onNext(result1);
            }
        });
    }


    //商家点击提醒收菜
    public void SendCallback(final int to_id, final String type, final int order_id, final String msg){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result1 = getInterface().SendCallback(to_id,type,order_id,msg);
                subscriber.onNext(result1);
            }
        });
    }

    //商家点击提醒收菜
    public void autoAuditcancelOrderSJ(final int order_id){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result1 = getInterface().autoAuditcancelOrderSJ(order_id);
                subscriber.onNext(result1);
            }
        });
    }

    //小号二次验证
    public void verifyTwice(final SmallAccountEntity o, final int user_id){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result1 = getInterface().verifyTwice(o,user_id);
                subscriber.onNext(result1);
            }
        });
    }

    //获取注册列表
    public void getModuleList(final String keyword, final int plat_type, final String status, final String startdate, final String enddate, final int start, final int pagesize){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result1 = getInterface().getModuleList( keyword, plat_type,  status, startdate, enddate,  start, pagesize);
                subscriber.onNext(result1);
            }
        });
    }
//获取注册详情

    public void getMoluldInfo(final int tmid){
        Observable1(new Observable.OnSubscribe<TaskMouldEntity>() {
            @Override
            public void call(Subscriber<? super TaskMouldEntity> subscriber) {
                TaskMouldEntity result1 = getInterface().getMoluldInfo(tmid);
                subscriber.onNext(result1);
            }
        });
    }
//同意拒绝注册单


    public void AuditTaskMoulds(final int tm_id, final int status, final String reason, final String userpay, final String requirement, final String doFlow, final String comment, final Date startdate, final Date enddate, final String rental, final String viceAccount, final String mainDeposit, final String viceDeposit, final List<TaskMouldRequireEntity> requireList){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result1 = getInterface().AuditTaskMould  ( tm_id, status, reason, userpay,  requirement, doFlow, comment, startdate, enddate, rental, viceAccount,mainDeposit,viceDeposit, requireList);
                subscriber.onNext(result1);
            }
        });
    }
//结束模板

    public void overMould(final int tm_id){
        Observable1(new Observable.OnSubscribe<IAcross>() {
            @Override
            public void call(Subscriber<? super IAcross> subscriber) {
                IAcross result1 = getInterface().overMould  ( tm_id);
                subscriber.onNext(result1);
            }
        });
    }



}
